home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
UpTime Volume 2 #4
/
utv2n4s2.d64
/
vision times ii
(
.txt
)
< prev
Wrap
Commodore BASIC
|
2022-08-28
|
10KB
|
393 lines
2 clr
4 rem data 32,155,183,138,72,32,155,183,104,170,164,101,24,76,240,255
6 bc=198:if fre(1)<>fre(0) then bc=208
7 rem sa=32768
8 rem for j=sa to sa+15:read x:poke j,x:next j
10 poke53280,0:poke53281,0
12 xr=781:yr=782:pr=783
14 if bc>200 then xr=7:yr=8:pr=5
16 er$=" "
20 dims(11),s$(11),se$(11),s1(20)
100 gosub4000
105 gosub 10000
107 gosub 21000
108 gosub 7500
110 gosub3600
120 h=0:v=10:tx$="[196]o you need a lesson? "
130 gosub3200
135 gosub 7600
140 lo=0:gosub2100
150 ifa$="y"ora$="[217]"thengosub20000:goto 160
151 if a$="n" or a$="[206]" then 160
152 goto 120
160 gosub5000
165 ru=1
170 gosub1000
172 ifop<>3then180
174 gosub3600
176 gosub500
180 gosub3600
190 v=10:tx$="[196]o you want to play again? ([217]/[206]) "
200 gosub3000:gosub 3200:gosub 7600
210 lo=0:gosub2100:printa$
220 ifa$="y"ora$="[217]"thenprinttab(23)"[145] ":goto 160
221 if a$="n" or a$="[206]" then 230
222 goto 190
230 sys 8*4096+4
500 v=10:h=0:tx$="[217]ou got"+str$(np-mi)+" right out of"+str$(np) +" problems"
510 gosub3200
540 v=12:tx$="for"+str$(int(((np-mi)/np)*100))+"%."
545 gosub3200:gosub 7600
550 delay=5:gosub2000
560 return
1000 rem *** central routine ***
1005 hp=0:mi=0
1010 fori=1tonp
1020 gosub19000
1025 gosub 7500:gosub3600
1030 h=0:v=6:tx$="[198]ind the "+md$+":"
1035 gosub3200:gosub 7600:if md<>1 then 1065
1040 gosub 7000
1050 goto 1066
1065 onopgosub11000,11000,17000
1066 v=24:tx$=" <[210][197][212][213][210][206]> to [195]ontinue, <[198]8> to [197]xit [146]"
1067 gosub3000:gosub3200
1068 lo=0:gosub2100
1069 if a$<>"[140]" and a$<>chr$(13) then 1068
1070 ifa$="[140]"then sa=i:i=np
1074 nexti:if sa<>0 thennp=sa
1075 gosub7500:return
2000 rem *** timer ***
2010 ti$="000000"
2015 geta$:ifa$<>""then2030
2020 ifti/60<delaythen2015
2030 return
2100 rem *** get character ***
2110 poke bc,0
2115 geta$:ifa$=""then2115
2117 if a$="[140]" then gosub 7500:goto 180
2120 a=val(a$):ifa<loora>hithen2115
2130 return
3000 rem *** center text ***
3010 x1=len(tx$)
3020 h=(40-x1)/2
3030 return
3100 v=24:tx$=" <[210][197][212][213][210][206]> to [195]ontinue [146]"
3110 gosub3000:gosub3200:gosub 7600
3120 lo=0:gosub2100
3130 ifa$<>chr$(13) then 3100
3140 return
3200 if h<0 then h=0
3210 poke xr,v:poke yr,h:poke pr,0:sys 65520:print tx$;:return
3500 rem *** line across screen ***
3510 print"";
3520 forq=1to20
3530 print"[178][178]";
3540 next
3550 forq=1to20
3560 print"[177][177]";
3570 next
3575 print"";
3580 return
3600 rem *** print screen header ***
3610 print"[147]"
3630 tx$="[214][201][211][201][207][206] [211][207][198][212][215][193][210][197] and"
3640 h=10:v=0:gosub 3200
3650 tx$="[213]p[212]ime [205]agazine [208]resents:":h=10:v=1:gosub 3200
3660 tx$=t$
3665 print"";
3670 h=10
3680 v=3:gosub3200
3685 print"";
3690 print:gosub3500:return
4000 rem *** read data ***
4005 readt$
4010 fori=1to6
4020 readrw$(i)
4030 nexti
4040 fori=1to3
4050 readop$(i)
4060 nexti
4070 fori=1to4
4080 readmu$(i),co(i)
4090 next:return
4100 rem *** program data ***
4110 data"[214]ision [212]imes [201][201]"
4120 data"[199]reat!","[198]antastic!","[211]uper!"
4130 data"[217]ou're really going now!","[217]es! [217]es! [217]es!","[212]hat's great!"
4140 data"[211]ee examples done."
4150 data"[196]o problems with help."
4160 data"[196]o problems yourself."
4170 data"units",28,"tens",30,"hundreds",31,"thousands",158
5000 rem *** setup for math ***
5001 ifru=1then5037
5010 h=0:v=10:tx$="[215]hat's your first name "
5020 gosub3200
5030 mx=16:gosub 11000:na$=te$
5035 if na$="" then na$="[195]omputer [215]iz"
5036 ifleft$(na$,1)<"z"thenna$=chr$(asc(left$(na$,1))+128)+right$(na$,len(na$)-1)
5037 v=10:h=0:tx$="[215]ould you like to: "
5038 gosub3200
5040 h=7:v=12:fori=1to3
5050 tx$=str$(i)+". "+op$(i)
5060 gosub3200
5070 v=v+2
5080 nexti
5090 h=0:tx$="[217]our choice? (1-3) "
5100 gosub3200
5110 lo=1:hi=3:gosub2100:printa$
5120 op=a:hi=10
5130 ifop=1thenhi=5
5140 gosub 7500:gosub 3600
5150 v=10:h=0:tx$="[200]ow many problems do you want"
5160 gosub3200
5170 v=11:tx$="to do? (2 -"+str$(hi)+") [157][157]"
5180 h=5:gosub3200:gosub 7600
5190 mx=2:gosub 11000:np=val(te$)
5200 ifnp<2 ornp>hithen np=0:goto5170
5210 v=13:tx$="[215]e will use 2 digit and 4 digit":h=0:gosub 3200
5220 v=14:h=5:tx$="numbers, "+na$+".":gosub 3200
5260 n1=4
5310 n2=2
5390 return
7000 rem option 1 - multiply
7010 v=9:h=38-len(se$(1)):tx$=se$(1):gosub 3200
7020 v=10:h=38-len(se$(2)):tx$=se$(2):gosub 3200
7025 v=11:h=37-len(se$(1)):tx$="[192][192][192][192][192][192][192][192]":if n1=3 then tx$=left$(tx$,8)
7030 gosub 3200 : if op=3 then 9000
7040 vv=0:for ii=3 to 1 step -2 :v=12+vv:h=0
7043 mu=val(mid$(se$(2),ii,1)): jk=1
7045 v=12+vv:h=0:tx$="[205]ultiply"+s$(1)+"by"+str$(mu*(10^vv))+".":gosub 3200
7046 delay=3:gosub 2000
7047 for jj=n(1)to 1 step-1 : v=18:h=0:tx$=er$:gosub 3200:v=16:gosub 3200
7048 v=20:gosub 3200
7049 v=16:h=0:tx$="[205]ultiply the "+mu$(jk)+"."
7050 gosub 3200:if op=1 then delay=1:gosub 2000
7054 v=18:h=0:tx$=str$(mu)+" x"+str$(d(jj)):if ca<>0 then tx$=tx$+" +"+ca$
7055 an=mu*d(jj)+ca:ca=int(an/10) :ca$=str$(ca):an$=str$(an)
7056 v=18:h=0:tx$=tx$+" = ":if op=1 then tx$=tx$+an$
7058 gosub 3200:if op=1 thengosub 2000
7060 vj=12+vv:hj=36-(vv*2)-(jk*2):if ca=0 then hj=hj+1
7061 if op=1 then 7080
7065 mx=3:gosub 11000:tt=val(te$)
7070 if tt=an then gosub 8000
7080 h=hj:hh=h:tx$=an$:v=vj
7090 gosub 3200:delay=.3:gosub 2000
7091 if ca=0 then 7150
7095 tx$="[195]arry the"+ca$+".":v=20:h=0:gosub 3200
7100 tx$=""+ca$:v=8:h=hh-1+(vv*2):gosub 3200
7110 tx$=" ":v=12+vv:h=hh:gosub 3200
7150 jk=jk+1:delay=3: gosub 2000
7155 next jj:if ca<>0 thenv=12+vv:h=hh-1:tx$=ca$:gosub 3200
7160 vv=vv+1:tx$=er$:v=8:h=10:gosub 3200:ca=0:gosub 3100:v=24:tx$=er$
7165 gosub 3000: gosub 3200:next ii
7170 v=12+vv:h=hh-1:tx$="[192][192][192][192][192][192][192][192][192][192][192]"
7175 if n1>=4 then tx$=tx$+"[192]"
7180 gosub 3200 :for v=16 to 20 step 2:h=0:tx$=er$:gosub 3200:next v
7185 v=16:tx$="[206]ow add:":gosub 3200 :if op=1 then 7210
7190 if op=2 then s$=se$(7):gosub 14000:goto 7240
7210 v=16:hh=36 :for jj=len(se$(7))-1 to 1 step-2:h=hh:tx$=mid$(se$(7),jj,1)
7220 gosub 3200:delay=2:gosub 2000:hh=hh-2
7230 next jj
7240 return
7500 poke 53265,11
7510 rem poke 53296,255
7520 return
7600 rem poke 53296,0
7610 poke 53265,27
7620 return
8000 rw=int(rnd(0)*6)+1
8010 forj=1to2
8020 v=20:h=5 :tx$=chr$(co(j))+rw$(rw)
8030 gosub3200
8040 delay=.3:gosub2000
8050 tx$=chr$(5)+er$:gosub3200
8060 delay=.1:gosub2000
8070 nextj :return
9000 v=15:h=0 :tx$="[217]our answer: "
9010 gosub3200
9020 mx=5:gosub 11000:an=val(te$)
9030 ifint(an)=int(s(7))then9080
9040 mi=mi+1
9050 v=17:tx$="[212]he correct answer is "+s$(7)+"." :h=0
9060 gosub3200
9070 goto 9180
9080 rw=int(rnd(0)*6)+1
9090 forj=1to5
9100 v=20:tx$=chr$(co(j))+rw$(rw)
9110 gosub3000:gosub3200
9120 delay=.7:gosub2000
9130 tx$=er$
9140 gosub3000:gosub3200
9150 delay=.3:gosub2000
9160 nextj
9180 return
10000 rem *** do spritey things ***
10010 sa=704:if bc>200 then sa=2816
10020 for i=sa to sa+63
10030 readx:pokei,x
10040 next
10050 poke2040,11:if bc>200 then poke 2040,44
10060 poke53287,2:poke53277,255:poke53271,255
10070 poke53248,30:poke53249,58
10075 if bc>200 then (NULL) 1,30,58
10080 return
10090 data252,252,252,121,249,248,51,243,240
10100 data7,231,224,15,207,192,7,159,128
10110 data3,63,0,0,126,0,0,252,0
10120 data0,120,0,0,48,0,0,0,0
10130 data0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
11000 te$="":print"[164]";
11010 get a$:if a$="" then 11010
11020 if a$=chr$(13) then printchr$(20):return
11030 if a$=chr$(20) and te$="" then 11010
11040 if a$=chr$(20) then te$=left$(te$,len(te$)-1):printa$a$"[164]";:goto 11010
11045 if a$="[140]" then gosub 7500:goto 180
11050 if a$<" " or a$>"[218]" then 11010
11060 if a$>"z" and a$<"[193]" then 11010
11070 if len(te$)=mx then 11010
11080 printchr$(20)a$"[164]";
11090 te$=te$+a$:goto 11010
14000 rem *** examples with help ***
14010 v1=16:h1=36:s$=se$(7)
14020 forj=len(s$)-1 to1step-2
14030 v=v1+1:h=h1:tx$="^":gosub 3200
14050 y=0:lo=0:hi=9
14060 gosub2100
14070 ifa$=mid$(s$,j,1)then14150
14080 y=y+1:ify<3then14060
14090 v=23:tx$="[197]nter a "+mid$(s$,j,